package com.itheima.tanhua.controller;

import com.itheima.tanhua.dto.LocationDto;
import com.itheima.tanhua.service.BaiduService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

/**
 * @author Lff
 * @date 2022/4/1
 * <p>
 * 地理位置上报
 */
@RestController
@RequestMapping("/baidu")
public class BaiduController {

    @Autowired
    private BaiduService baiduService;

    /**
     * 上报地理位置
     *
     * @param locationDto
     * @return
     */
    @PostMapping("/location")
    public ResponseEntity location(@RequestBody LocationDto locationDto) {
        baiduService.uploadLocation(locationDto);
        return ResponseEntity.ok(null);
    }
}
